import pymysql

# 创建连接对象
conn = pymysql.connect(
    host='localhost',
    port=3306,
    user='root',
    password='',
    database='test'
)

# 获取游标对象
cursor = conn.cursor()







# 关闭游标
cursor.close()
# 关闭连接1.test1.py
conn.close()

